package gmusic.mb.bo;

import gmusic.bo.ArtistBean;
import gmusic.services.impl.GMusicServicesImpl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

public class ArtistMBBean extends ArtistBean {

	protected String mbid = null;

	protected int score = -1;

	protected List<ReleaseMBBean> releasesMB = null;

	public ArtistMBBean() {

	}

	public ArtistMBBean(ResultSet rs) throws SQLException {
		setMbid(rs.getString("mbid"));
		setNom(rs.getString("nom"));
	}

	public String toString() {
		return "[MBID " + mbid + "] " + nom;
	}

	public String getMbid() {
		return mbid;
	}

	public void setMbid(String mbid) {
		this.mbid = mbid;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public List<ReleaseMBBean> getReleasesMB() {
		return releasesMB;
	}

	public void setReleasesMB(List<ReleaseMBBean> releasesMB) {
		this.releasesMB = releasesMB;
	}

	public boolean existsInGM() throws SQLException {
		return GMusicServicesImpl.getInstance().artistMBExists(mbid);
	}
}
